1. Field of the Invention
The present invention relates to a processing apparatus of portable electronic devices, a portable electronic device, and a processing system of portable electronic devices, each configured to transmit and receive various commands and to process data in various ways in accordance with the commands.
2. Description of the Related Art
IC cards used as portable electronic devices comprise a main body and an IC module. The main body is shaped like a card and made of plastic, etc. The IC module is embedded in the main body and has an IC chip. The IC chip has a nonvolatile memory, a volatile memory, and a CPU. The nonvolatile memory is, for example, an electronically erasable programmable read-only memory (EEPROM) or a flash ROM. The volatile memory is, for example, a RAM. The CPU can perform various operations.
Any IC card that accords with Standard ISO/IEC7816-1 and 2 of the International Standards Organization excels in portability. The IC card can communicate with external apparatuses and can perform complex operations. IC cards can hardly be forged, and can store data that should be kept in secret. IC cards are used in security systems, as ID cards of license holders, company employees, club members and insurance holders, credit cards, passports, or ID cards for use in electronic transactions.
In recent years, IC cards having various functions have come into use. Jpn. Pat. Appln. KOKAI Publication No. 2005-216234 (Japanese patent document), for example, discloses an IC card that comprise a contact interface and a non-contact interface. The contact interface has metal terminals. The non-contact interface has an antenna. The antenna is designed to transmit and receive radio waves.
Any IC card (i.e., non-contact IC card) that has a non-contact interface can perform communication involving no physical contacts, in order to transmit and receive data. The non-contact IC card detects the magnetic field emanating from a card reader/writer. The non-contact IC card generates an electromotive force, because the magnetic field achieves electromagnetic induction to the antenna. The electromotive force thus generated drives the components of the non-contact IC card.
Usually, an IC card and the processing apparatus of IC card perform processes, to authenticate each other, and thereby determine whether they can communicate to exchange data. Jpn. Pat. Appln. Publication No. 2007-48103, a Japanese patent document, discloses a technique of permitting an IC card and an apparatus to communicate with each other, if they are found authenticated to communicate mutually.
To process the read from, for example, an IC card that accords with Standard ISO/IEC1444, Type B, a processing apparatus of IC-card first performs an anti-collision sequence and then acquires the card data (medium data) from the IC card.
To perform the anti-collision sequence, the IC card reader/writer incorporated in the processing apparatus of IC-card transmits a REQB command to the IC card. On receiving the REQB command, the IC card transmits an ATQB, as response, to the IC card reader/writer.
In the processing apparatus of IC-card, the ATQB is supplied to the IC card reader/writer. The IC card reader/writer transmits an ATTRIB command to the IC card. On receiving the ATTRIB command, the IC card transmits Answer-to-ATTRIB (ATA), as response, to the IC card reader/writer.
The processing apparatus of IC-card first performs the above-mentioned anti-collision sequence and then performs a process to acquire the card data of the IC card.
In order to acquire the card data of the IC card, the processing apparatus of IC-card transmits a select command and a read command to the IC card. The selected command contains the data that identifies one of the files the IC card holds. To read the card data, the processing apparatus of IC-card adds the data identifying the file containing the card data, to the select command.
On receiving the select command, the IC card selects a file in accordance with the data designating the file. The file thus selected is read from the IC card and transmitted to the processing apparatus of IC-card.
As described above, the anti-collision sequence should be performed to acquire data from the IC card by virtue of non-contact communication. However, the communication may be performed in an undesirable way if the power supply to the IC card from the processing apparatus of IC-card is interrupted or if the noise is generated in the IC card due to disturbance.
The communication may be performed in an undesirable way during the anti-collision sequence or before the transmission of the read command. In this case, the processing apparatus of IC-card needs to perform the anti-collision sequence again. Consequently, much time will elapse before the IC-card data is acquired.
To accomplish the mutual authentication of the IC card and the processing apparatus of IC-card, the processing apparatus of IC-card generates a random number. The processing apparatus then encrypts the random number. The processing apparatus transmits the random number encrypted, or encrypted data, to the IC card. The IC card decrypts the encrypted data and transmits the data back to the processing apparatus of IC-card. The IC card generates a random number and encrypts the random number. The random number encrypted is transmitted to the processing apparatus of IC-card.
The processing apparatus of IC-card decrypts the encrypted data and transmits the same to the IC card. The IC card determines whether the decrypted data that has been transmitted from the processing apparatus is identical to the random number. Similarly, the processing apparatus of IC-card determines whether the decrypted data transmitted from the IC card is identical with the random number. Thus, the IC card and the processing apparatus of IC-card authenticate each other.
The mutual authentication described above is accomplished as commands and responses are exchanged several times between the IC card and the processing apparatus of IC-card. In most cases, the number of times the commands and responses are exchanged directly influences the speed of processing data. In view of this, this number of times should better be decreased as much as possible.
The IC cards and processing apparatus of IC-card and the IC card, which are disclosed in Jpn. Pat. Appln. Publication No. 2007-48103, exchange commands and response with each other, two times, to authenticate each other. Consequently, the mutual authentication requires a long time including the time required to achieve the exchange of commands and responses.